<extend name="Public:base" />
<block name="left">
    <ul class=" ">
        <li><a href="{:U('Person/auth')}">           实名认证</a></li>
        <li><a href="{:U('Person/set_pwdtrade')}">   交易密码设置</a></li>
        <li><a href="{:U('Person/updatepwd')}">      修改登录密码</a></li>
        <li><a href="{:U('Person/change_pwdtrade')}">修改交易密码</a></li>
        <li><a href="{:U('Person/forgot_pwdtrade')}">找回交易密码</a></li>
     
        <li><a href="{:U('Person/mail_check')}">邮箱验证</a></li>
      <!--   <li><a href="">邮件通知</a></li>
         <li><a href="">设置双重验证</a></li>
        <li><a href="">手机绑定</a></li>
      -->
    </ul>
</block>
<block name="right">
    <br>
   
     <div class="ziliao">

        <div class="top-tip margin-top-20 clearfloat">
                温馨提示：你好，您正在修改交易密码 ！
        </div>
         <br>

    <br>
            <if condition="$userinfos['pwdtrade'] eq ''">
                <h1>您还没有交易密码，点<a href="{:U('Person/set_pwdtrade')}" style="display: initial;">这里</a>去设置交易密码</h1>
            <else/>
       <form action="{:U('Person/change_pwdtrade_act')}" method="POST" id="change_pwd" onsubmit="return check_form()">
            <div class="col-xs-10">
                <label class="label-name">原密码: &nbsp&nbsp</label>
                <input type="password"  class="ziliaobucz"  name="pwdtrade_org" id="pwdtrade_org">
            </div>
            <br>

            <div class="col-xs-10">
                <label class="label-name">新密码: &nbsp&nbsp</label>
                <input type="password" class="ziliaobucz"  name="pwdtrade_new" id="pwdtrade_new">
            </div>
            <br>

            <div class="col-xs-10">
                <label class="label-name">确认密码: &nbsp </label>
                <input type="password" class="ziliaobucz" name="pwdtrade_cfm" id="pwdtrade_cfm">
            </div>
            <br>
            <div>
                <input type="submit" class="ziliaobu" name="submit" value="保存"> &nbsp &nbsp  
            <input class="ziliaobu" type="reset" name="reset" value="重 置"> 
            </div>

        </form> 
    </if>
    </div>

    <div></div>


<script type="text/javascript">
                function check_form() {
                    var pwdtrade_org = document.getElementById('pwdtrade_org');
                    var pwdtrade_new = document.getElementById('pwdtrade_new');
                    var pwdtrade_cfm = document.getElementById('pwdtrade_cfm');
                    var reg =/^\d{6}$/;
                    var err_msg = '';
                    if (pwdtrade_org.value == '') {
                        err_msg += '原密码不能为空\n';
                        pwdtrade_org.value = '';
                    }
                    if (!reg.test(pwdtrade_new.value)) {
                        err_msg += '密码格式为6位数字\n';
                        pwdtrade_new.value = '';
                    }
                    if (pwdtrade_new.value != pwdtrade_cfm.value) {
                        err_msg += '再次密码输入不一致\n';
                        pwdtrade_new.value = '';
                        pwdtrade_cfm.value = '';
                    }
                    if (err_msg != '') {
                        alert(err_msg);
                        return false;
                    }
                    return true;
                }
            </script>
</block>